<template>
	<view class="mord">
		<view class="top">
			<view class="mo" v-if='user != null'>
				<view class="r">
					<navigator url="/pages/user/system" class="ico a">
						<image src="../../static/img/3/3-13.png" mode="widthFix"></image>
					</navigator>
					<navigator url="/pages/user/msgoder" class="ico b">
						<image src="../../static/img/3/tel.png" mode="widthFix"></image>
						<text v-if="numb<=99">{{numb}}</text>
						<text v-if="numb>99">99+</text>
					</navigator>
				</view>
				<view class="head">
					<navigator url="/pages/user/userset">
						<image v-if='user.cPortrait' :src="user.cPortrait" mode=""></image>
					<image v-else src="../../static/img/3/3-8.png" mode=""></image>
					</navigator>
					<view class="text" v-if="user != null">
						<view>
							{{user.cUserName}}
						</view>
						<navigator url="/pages/user/ding" class="bu">
							签到
						</navigator>
					</view>
				</view>
				<view class="list">
					<view class="li"  v-if="user != null">
						{{user.iPoints}}
						<view>
							资产
						</view>
					</view>
					<navigator url="/pages/user/collectiondp" class="li">
						120
						<view>
							店铺
						</view>
					</navigator>
					<navigator v-if="footprint != null" url="/pages/user/footprint" class="li">
						{{footprint}}
						<view>
							足迹
						</view>
					</navigator>
					<navigator  v-if="collection != null" url="/pages/user/collection" class="li">
						{{collection}}
						<view>
							收藏
						</view>
					</navigator>
				</view>
				<view class="mons">
					<view class="mon-n">
						<image src="../../static/img/3/3-15.png" mode="widthFix"></image>
						<text>{{user.cMemberLevelName}}</text>
						<!-- <view class="righ">
							会员专享限时5折
						</view> -->
					</view>
				</view>
			</view>
		
				<!-- <image class="bac" src="../../static/img/3/3-14.png" ></image> -->
		
		</view>
		<view class="bottom">
			<view class="boa">
				<view class="h3">
					我的订单
					<navigator url="/pages/user/order"><text>查看全部订单</text>
						<image src="../../static/img/3/3-17.png" mode="widthFix"></image>
					</navigator>
					<view class="both"></view>
				</view>
				<view class="box">
					<navigator url="/pages/user/order?id=1">
						<image src="../../static/img/3/3-18.png" mode="widthFix"></image>
						待付款
						<i>{{PAYMONEY.count}}</i>
					</navigator>
					<navigator url="/pages/user/order?id=2">
						<image src="../../static/img/3/3-19.png" mode="widthFix"></image>
						待发货
						<i>{{DELIVERGOODS.count}}</i>
					</navigator>
					<navigator url="/pages/user/order?id=3">
						<image src="../../static/img/3/3-20.png" mode="widthFix"></image>
						待收货
						<i>{{TAKEDELIVERY.count}}</i>
					</navigator>
					<navigator url="/pages/user/order?id=4">
						<image src="../../static/img/3/3-21.png" mode="widthFix"></image>
						待评价
						<i>{{ENDORDER.count}}</i>
					</navigator>
					<navigator url="/pages/user/shfw">
						<image src="../../static/img/3/3-22.png" mode="widthFix"></image>
						退款/售后
					</navigator>
				</view>

			</view>
			<view class="banner">
				<image src="../../static/img/3/3-23.png" mode="widthFix"></image>
			</view>
			<view class="boa hd">
				<view class="h3">
					会员互动
				</view>
				<view class="box">
					<navigator url="/pages/user/share">
						<image src="../../static/img/3/3-24.png" style="width: 39rpx;" mode="widthFix"></image>
						邀请有礼
					</navigator>
					<navigator url="/pages/user/task">
						<image src="../../static/img/3/3-25.png" style="width: 34rpx;" mode="widthFix"></image>
						任务中心
					</navigator>
					<navigator url="/pages/user/comment">
						<image src="../../static/img/3/3-26.png" style="width: 45rpx;" mode="widthFix"></image>
						评论
					</navigator>
					<navigator url="/pages/comment/index">
						<image src="../../static/img/3/3-27.png" style="width: 47rpx;" mode="widthFix"></image>
						评论专题
					</navigator>
				</view>
			
			</view>
			<view class="boa fw">
				<image src="../../static/img/3/3-28.png" class="fonts" mode="widthFix"></image>
				<view class="h3">
					服务中心
				</view>
				<view class="box">
					<navigator url="/pages/user/fw">
						<image src="../../static/img/3/3-29.png" style="width: 43rpx;" mode="widthFix"></image>
						客服咨询
					</navigator>
					<navigator url="/pages/user/card">
						<image src="../../static/img/3/3-30.png" style="width: 50rpx;" mode="widthFix"></image>
						实体卡
					</navigator>
					<navigator url="">
						<image src="../../static/img/3/3-31.png" style="width: 61rpx;" mode="widthFix"></image>
						礼品卡
					</navigator>
					<navigator url="">
						<image src="../../static/img/3/3-32.png" style="width: 43rpx;" mode="widthFix"></image>
						企业采购
					</navigator>
					<navigator url="/pages/user/cooperation">
						<image src="../../static/img/3/3-33.png" style="width: 44rpx;" mode="widthFix"></image>
						商务合作
					</navigator>
				</view>
			
			</view>
			
		</view>
		<!-- <Guess></Guess> -->
	</view>
</template>

<script>
		import Guess from "../../components/like/guess.vue"
	export default {
		name: "",
		components:{Guess},
		data() {
			return {
				user:null,
				collection:null,
				footprint:null,
				mid:null,
				ENDORDER:[],
				PAYMONEY:[],
				DELIVERGOODS:[],
				TAKEDELIVERY:[],
				numb:0
			}
		},
		onLoad(){
		},
		onShow() {
			
				var that = this;
				that.$Request.post(
					that.$api.httpApi.user.getDifBulletins+'?token='+that.$SysCache.get('token')+'&message_type=order',
					).then(res=>{
						if(res.code == 200){
							that.numb+=res.data.count
						}
					});
					that.$Request.post(
					that.$api.httpApi.user.agents,
					).then(res=>{
						// if(res.code == 200){
						// 	that.numb+=res.data.count
						// }
					});	
					that.$Request.post(
						that.$api.httpApi.user.getDifBulletins+'?token='+that.$SysCache.get('token')+'&message_type=account',
						).then(res=>{
							if(res.code == 200){
								that.numb+=res.data.count
								
							}
						});	
						that.$Request.post(
						that.$api.httpApi.user.getDifBulletins+'?token='+that.$SysCache.get('token')+'&message_type=system',
						).then(res=>{
							if(res.code == 200){
								that.numb+=res.data.count
							}
						});	
				that.$Request.post(
				that.$api.httpApi.user.oder+'&token='+that.$SysCache.get('token'),
				{'onLineOffLine':0,'orderType':2,status:'PAYMONEY'}
				).then(res=>{
					if(res.code == 200){
						that.PAYMONEY=res.data;
						// console.log(res.data)
					}
				});
				that.$Request.post(
				that.$api.httpApi.user.oder+'&token='+that.$SysCache.get('token'),
				{'onLineOffLine':0,'orderType':2,status:'DELIVERGOODS'}
				).then(res=>{
					if(res.code == 200){
						that.DELIVERGOODS=res.data;
					}
				});
				that.$Request.post(
				that.$api.httpApi.user.oder+'&token='+that.$SysCache.get('token'),
				{'onLineOffLine':0,'orderType':2,status:'TAKEDELIVERY'}
				).then(res=>{
					if(res.code == 200){
						that.TAKEDELIVERY=res.data;
					}
				});
				that.$Request.post(
				that.$api.httpApi.user.oder+'&token='+that.$SysCache.get('token'),
				{'onLineOffLine':0,'orderType':2,status:'ENDORDER'}
				).then(res=>{
					if(res.code == 200){
						that.ENDORDER=res.data;
					}
				});
				that.$Request.post(
					that.$api.httpApi.user.userinfo+'&token='+that.$SysCache.get('token'),
					).then(res=>{
						if(res.code == 200){
							that.user=res.data;
						}
					});	
					
					that.$Request.post(
					that.$api.httpApi.user.collection+'&token='+that.$SysCache.get('token')
					).then(res=>{
						if(res.code == 200){
							that.collection=res.data.pager.totalCount
						}
					});
					that.$Request.post(
					that.$api.httpApi.user.footprint+'&token='+that.$SysCache.get('token')
					).then(res=>{
						if(res.code == 200){
							that.footprint=res.data.pager.totalCount
						}
					});
		},
		methods:{
			ge(){
				var that = this;
			// var token=that.$SysCache.get('token');
			// 	console.log(token)
			}
		}
	}
</script>

<style scoped>
	uni-page-head{
		display: none !important;
		overflow: hidden;
	}
	uni-page-head .uni-page-head{
		display: none;
	}
	.top {
		/* background: url(/static/img/3/3-14.png) no-repeat; */
		background-size: 100% 100%;
		padding-top: 15rpx;
		position: relative;
	}
	.banner {
		margin-top: 25rpx;
	}
.hd {
		margin-top: 25rpx;
	}
	.banner image {
		display: block;
		width: 100%;
	}

	.both {
		display: block;
		clear: both;
	}

	.box {
		display: flex;
		margin-top: 30rpx;
	}
	
.hd .box{
	margin-top: 34rpx;
}
.fonts{
	display: block;
	width: 95%;
	margin: auto;
}
	.box navigator {
		flex: 1;
		text-align: center;
		font-size: 22rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(77, 77, 77, 1);
		position: relative;
	}
	.box navigator i{
		display: block;
		width: 25rpx;
		height: 25rpx;
		border-radius: 50%;
		background: #DD524D;
		font-size: 12rpx;
		color: #fff;
		text-align: center;
		position: absolute;
		top: -10rpx;
		right: 35rpx;
		line-height: 25rpx;
	}

	.box navigator image {
		display: block;
		width: 54rpx;
		margin: auto;
		margin-bottom: 21rpx;
	}

	.boa .h3 {
		font-size: 26rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		width: 90%;
		margin: auto;
		color: rgba(77, 77, 77, 1);
	}

	.boa .h3 navigator {
		float: right;
		font-size: 16rpx;
		font-family: Microsoft YaHei;
		font-weight: 300;
		color: rgba(119, 119, 119, 1);
	}

	.boa .h3 navigator image {
		display: inline-block;
		width: 12rpx;
		vertical-align: middle;
	}

	.boa .h3 navigator text {
		display: inline-block;
		vertical-align: middle;
		margin-right: 6rpx;
	}

	.boa {
		background: #fff;
		padding-top: 18rpx;
		padding-bottom: 18rpx;
	}

	.bottom {
		width: 95%;
		margin: auto;
	}

	.mon-n {
		width: calc(100% - 82rpx);
		margin: auto;
		height: 77rpx;
		line-height: 86rpx;
	}

	.mon-n image {
		display: inline-block;
		width: 51rpx;
	}

	.mon-n text {
		display: inline-block;
		font-size: 22rpx;
		font-family: FZQKBYSJW;
		font-weight: normal;
		color: rgba(255, 255, 255, 1);
		margin-left: 3rpx;
	}

	.mon-n .righ {
		float: right;
		font-size: 25rpx;
		font-family: FZQKBYSJW;
		font-weight: normal;
		color: rgba(255, 255, 255, 1);
		line-height: 77rpx;
	}

	.mons {

		background: rgba(189, 151, 89, 1);
		border-radius: 30rpx 30rpx 0px 0px;
	}

	.mord {
		background: #EEEEEE;
	}

	.list {
		display: flex;

	}

	.list .li {
		flex: 1;
		padding-top: 40rpx;
		padding-bottom: 40rpx;
		font-size: 24rpx;
		font-family: Microsoft YaHei;
		/* font-weight:bold; */
		color: rgba(255, 255, 255, 1);
		line-height: 26rpx;
		text-align: center;
	}
.list .li view{
	margin-top: 8rpx;
}
	.head image {
		display: inline-block;
		vertical-align: middle;
		width: 89rpx;
		height: 89rpx;
		background: rgba(255, 255, 255, 1);
		border-radius: 45rpx;
	}

	.head .text {
		display: inline-block;
		vertical-align: middle;
		margin-left: 20rpx;
		font-size: 24rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(255, 255, 255, 1);
	}

	.head .bu {
		width: 64rpx;
		height: 25rpx;
		background: rgba(255, 255, 255, 0);
		border: 1px solid rgba(189, 151, 89, 1);
		border-radius: 13rpx;
		font-size: 15rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(189, 151, 89, 1);
		text-align: center;
		line-height: 25rpx;
		margin-top: 14rpx;
	}
	.head navigator{
		display: inline-block;
		vertical-align: middle;
	}
	.mo {
		width: 95%;
		margin: auto;
		position: relative;
		z-index: 10;
	}

	

	.r {
		text-align: right;

	}

	.r .ico {
		display: inline-block;
		vertical-align: bottom;
		margin-left: 21rpx;
		position: relative;
	}

	.r .a image {
		display: block;
		width: 35rpx;
		height: 35rpx;
	}

	.r .b image {
		display: block;
		width: 30rpx;
		height: 30rpx;
	}

	.r .ico text {
		display: block;
		width: 18rpx;
		height: 18rpx;
		background: #F0406F;
		border-radius: 50%;
		position: absolute;
		right: -10rpx;
		top: -10rpx;
		color: #fff;
		font-size: 14rpx;
		text-align: center;
		line-height: 18rpx;
	}
	.fw{
		margin-top: 25rpx;
		padding-top: 0;
	}
	.fw .h3{
		margin-top: 20rpx;
	}
	.top .bac{
		display: block;
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		z-index: 5;
	}
</style>
